import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0
import QtQuick.Controls.Private 1.0

Button{
    width: 150
    style: ButtonStyle{
        background: Image{
            width: 150
            fillMode: Image.PreserveAspectFit
            source: "qrc:/images/btnbg.png"
            opacity: control.hovered ? 0.7 : 1.0
        }
        label: Item {
                implicitWidth: row.implicitWidth
                implicitHeight: row.implicitHeight
                baselineOffset: row.y + text.y + text.baselineOffset
                Row {
                    id: row
                    anchors.centerIn: parent
                    spacing: 2
                    Image {
                        source: control.iconSource
                        anchors.verticalCenter: parent.verticalCenter
                    }
                    Text {
                        id: text
                        font.pixelSize: 15
                        font.family: "微软雅黑"
                        renderType: Settings.isMobile ? Text.QtRendering : Text.NativeRendering
                        anchors.verticalCenter: parent.verticalCenter
                        text: StyleHelpers.stylizeMnemonics(control.text)
                        color: SystemPaletteSingleton.buttonText(control.enabled)
                    }
                }
            }
    }
}
